#pragma once
#include "GSE_ErrCode.h"
namespace GSE
{
	class error_code : public ErrCode
	{
	public:
		error_code():_value(0){}
		// explicit constructor
		error_code(int value, const char * msg)
		{
			set_error(value, msg);
		}

		void set_error(int value, const char * msg)
		{
			_value = value;
			_message = msg;
		}

		// get the error code
		virtual int errCode() const
		{
			return _value;
		}

		virtual const char * errMsg() const
		{
			return _message.c_str();
		}

		virtual bool operator !() const
		{
			return _value == 0;
		}

	private:
		int _value;
		std::string _message;
	};

}